package cn.lanqiao.print;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;


@Component
public class Printer {

    private Ink ink;

    private Paper paper;

    public void print(String word) {
        System.out.println("使用" + ink.getColor() + "颜色的墨盒，" + paper.getSize() + "纸张打印....");
        System.out.println(word);
    }

    @Autowired
    public void setInk(Ink ink) {
        this.ink = ink;
    }

//    @Autowired
//    @Qualifier("a4Paper")
    @Resource(name="b5Paper")
    public void setPaper(Paper paper) {
        this.paper = paper;
    }
}
